package com.caibq.service.impl;

import com.caibq.eum.MessageEnum;
import org.springframework.stereotype.Service;

/**
 * projectName: demoBox
 *
 * @author: caicai
 * time: 2024/1/11 10:57 周四
 * description:
 */
@Service
public class MessageEnumService {


    //public String getMessage(int code) {
    //    if (code == 1) {
    //        return"成功";
    //    } else if (code == -1) {
    //        return"失败";
    //    } else if (code == -2) {
    //        return"网络超时";
    //    } else if (code == -3) {
    //        return"参数错误";
    //    }
    //    throw new RuntimeException("code错误");
    //}
    public String getMessage(int code) {
        MessageEnum messageEnum = MessageEnum.getMessageEnum(code);
        return messageEnum.getMessage();
    }

}
